# CMakeList.txt: 顶层 CMake 项目文件，在此处执行全局配置
# 并包含子项目。
#
cmake_minimum_required (VERSION 3.8)

### 设置目标文件名
set(TARGETNAME demo)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/lib)
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/bin)

### 增加opencv支持
# set(OpenCV_DIR /usr/local/opencv-3.4.1/share/OpenCV/)
# find_package(OpenCV 3.4.1 REQUIRED)

find_package(Poco REQUIRED COMPONENTS
Foundation
Net
XML
Util
DataSQLite
Data
JSON
) 

if(Poco_FOUND)
	message(STATUS "Found Poco")
endif()

# find_library(ZMQ zmq)

### 头文件路径

include_directories(
${PROJECT_SOURCE_DIR}/3rdpart/include
)

### 库文件路径
link_directories(
	# ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
	${PROJECT_BINARY_DIR}/${CMAKE_BUILD_TYPE}/lib
)

add_executable(${TARGETNAME} main.cpp)

### 链接库
target_link_libraries(${TARGETNAME} 
#-Wl,--start-group
# ${ZMQ}
Poco::Foundation
Poco::Net
Poco::Util
Poco::DataSQLite
Poco::Data
Poco::JSON
pthread
glog
#-Wl,--end-group
)
